package testing.checker;


import static org.junit.Assert.assertEquals;

import java.util.ArrayList;

import org.junit.Before;
import org.junit.Test;

import checker.ArrayChecker;
import checker.SingleChecker;

public class SingleCheckerTest {
	SingleChecker checker;
	ArrayList<String> original_array;
	ArrayList<String> compared_array;
	@Before
	public void setUp() throws Exception {
		this.original_array = new ArrayList<String>();
		this.compared_array = new ArrayList<String>();
		this.checker = new SingleChecker();
	}
	@Test
	public void test1()
	{
		String origin[] = {"advocate"};
		String compare[] = {"advocate"};
		checker.set_origin_stringarray(origin);
		checker.set_compared_stringarray(compare);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,1);
		
	}
	@Test
	public void test2()
	{
		String origin[] = {"advocate"};
		String compare[] = {"advocates"};
		checker.set_origin_stringarray(origin);
		checker.set_compared_stringarray(compare);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,0);
		
	}
	@Test
	public void test3()
	{
		String origin[] = {"advocate","common"};
		String compare[] = {"advocate","common"};
		checker.set_origin_stringarray(origin);
		checker.set_compared_stringarray(compare);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,2);
		
	}
	@Test
	public void test4()
	{
		String origin[] = {"advocate","commons"};
		String compare[] = {"advocate","common"};
		checker.set_origin_stringarray(origin);
		checker.set_compared_stringarray(compare);
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,1);
	}
	@Test
	public void test5()
	{
		String origin[] = {"advocate","commons"};
		String compare[] = {"advocates","common"};
		checker.set_origin_stringarray(origin);
		checker.set_compared_stringarray(compare);		
		checker.compare();
		int result = checker.getCount();
		assertEquals(result,0);
		
	}

}


